package org.springframework.howelly.helpers;

import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;

import org.springframework.howelly.model.Gasto;

public class GastoChart implements Serializable {

    private static final long serialVersionUID = 6894730446053609161L;

    private int date;

    private Date fullDate;

    private String fullDateString;

    private int price;

    private double saldoParcial;

    private String expenseType;

    public GastoChart(Gasto gasto) {
	this.date = gasto.getDiaEfectuado().getDate();
	// this.price = gasto.getPrice().intValue();
	// this.setSaldoParcial(gasto.getSaldoParcial().doubleValue());
	this.fullDate = gasto.getDiaEfectuado();
	this.fullDateString = gasto.getDiaEfectuadoString();
	this.expenseType = gasto.getExpenseType();
    }

    public static final Comparator<GastoChart> ByDate = new Comparator<GastoChart>() {
	public int compare(GastoChart e1, GastoChart e2) {
	    int dateCmp = e1.getFullDate().compareTo(e2.getFullDate());
	    return dateCmp;

	}
    };

    public int getDate() {
	return date;
    }

    public void setDate(int date) {
	this.date = date;
    }

    public int getPrice() {
	return price;
    }

    public void setPrice(int price) {
	this.price = price;
    }

    public void setSaldoParcial(int saldoParcial) {
	this.saldoParcial = saldoParcial;
    }

    public Date getFullDate() {
	return fullDate;
    }

    public void setFullDate(Date fullDate) {
	this.fullDate = fullDate;
    }

    public String getFullDateString() {
	return fullDateString;
    }

    public void setFullDateString(String fullDateString) {
	this.fullDateString = fullDateString;
    }

    public String getExpenseType() {
	return expenseType;
    }

    public void setExpenseType(String expenseType) {
	this.expenseType = expenseType;
    }

    public void setSaldoParcial(double saldoParcial) {
	this.saldoParcial = saldoParcial;
    }

    public double getSaldoParcial() {
	return saldoParcial;
    }
}
